VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.1#0"; "mscomctl.OCX"
Begin VB.Form FrmAuditoria 
   Caption         =   "Form1"
   ClientHeight    =   10770
   ClientLeft      =   60
   ClientTop       =   420
   ClientWidth     =   11400
   LinkTopic       =   "Form1"
   ScaleHeight     =   10770
   ScaleWidth      =   11400
   StartUpPosition =   2  'CenterScreen
   WindowState     =   2  'Maximized
   Begin VB.CommandButton Command3 
      Caption         =   "Salir"
      BeginProperty Font 
         Name            =   "Eras Bold ITC"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   11640
      TabIndex        =   11
      Top             =   0
      Width           =   1215
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Mantenimientos"
      BeginProperty Font 
         Name            =   "Eras Bold ITC"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   9240
      TabIndex        =   10
      Top             =   0
      Width           =   2295
   End
   Begin VB.ComboBox Combo2 
      Height          =   315
      ItemData        =   "FrmAuditoria.frx":0000
      Left            =   6960
      List            =   "FrmAuditoria.frx":0019
      TabIndex        =   8
      Top             =   0
      Width           =   1215
   End
   Begin MSComCtl2.DTPicker DTPicker2 
      Height          =   375
      Left            =   2760
      TabIndex        =   7
      Top             =   0
      Width           =   1335
      _ExtentX        =   2355
      _ExtentY        =   661
      _Version        =   393216
      Format          =   239599617
      CurrentDate     =   40059
   End
   Begin MSComCtl2.DTPicker DTPicker1 
      Height          =   375
      Left            =   720
      TabIndex        =   5
      Top             =   0
      Width           =   1335
      _ExtentX        =   2355
      _ExtentY        =   661
      _Version        =   393216
      Format          =   239599617
      CurrentDate     =   40059
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Ver"
      BeginProperty Font 
         Name            =   "Eras Bold ITC"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   8280
      TabIndex        =   3
      Top             =   0
      Width           =   975
   End
   Begin VB.ComboBox Combo1 
      Height          =   315
      Left            =   4920
      TabIndex        =   2
      Top             =   0
      Width           =   1215
   End
   Begin MSComctlLib.ListView ListView1 
      Height          =   9855
      Left            =   0
      TabIndex        =   0
      Top             =   360
      Width           =   15255
      _ExtentX        =   26908
      _ExtentY        =   17383
      View            =   3
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      FullRowSelect   =   -1  'True
      GridLines       =   -1  'True
      HotTracking     =   -1  'True
      TextBackground  =   -1  'True
      _Version        =   393217
      ForeColor       =   -2147483640
      BackColor       =   16777215
      BorderStyle     =   1
      Appearance      =   1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      NumItems        =   6
      BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Text            =   "Usuario"
         Object.Width           =   2999
      EndProperty
      BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   1
         Text            =   "Fecha"
         Object.Width           =   2469
      EndProperty
      BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   2
         Text            =   "Hora"
         Object.Width           =   2999
      EndProperty
      BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   3
         Text            =   "Accion"
         Object.Width           =   3528
      EndProperty
      BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   4
         Text            =   "Modulo"
         Object.Width           =   2999
      EndProperty
      BeginProperty ColumnHeader(6) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   5
         Text            =   "Registro"
         Object.Width           =   3175
      EndProperty
   End
   Begin VB.Label SkinLabel2 
      Caption         =   "Desde:"
      Height          =   495
      Left            =   0
      TabIndex        =   4
      Top             =   0
      Width           =   1575
   End
   Begin VB.Label SkinLabel3 
      Caption         =   "Hasta:"
      Height          =   495
      Left            =   2040
      TabIndex        =   6
      Top             =   0
      Width           =   1575
   End
   Begin VB.Label SkinLabel4 
      Caption         =   "Acciones:"
      Height          =   375
      Left            =   6240
      TabIndex        =   9
      Top             =   0
      Width           =   1575
   End
   Begin VB.Label SkinLabel1 
      Caption         =   "Usuario:"
      Height          =   255
      Left            =   4080
      TabIndex        =   1
      Top             =   0
      Width           =   1575
   End
End
Attribute VB_Name = "FrmAuditoria"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Const Standar = "select *from auditoria WHERE USUARIO <> 'BRUNOBURGER'"
Sub Mostrar_detalle(sql)
On Error Resume Next
    Dim t As DAO.Recordset
    Dim subelemento As ListItem
    Set t = Base.OpenRecordset(sql)
    ListView1.ListItems.Clear
    While Not t.EOF
        Set subelemento = ListView1.ListItems.Add(, , t("usuario"))
        'subelemento.SubItems(1) = CampoExamen(t("cod_examen"), "descripcion")
        subelemento.SubItems(1) = t("fecha")
        subelemento.SubItems(2) = t("Hora")
        subelemento.SubItems(3) = t("Accion")
        subelemento.SubItems(4) = t("Modulo")
        subelemento.SubItems(5) = t("Registro")
         t.MoveNext
    Wend
End Sub

Private Sub Command1_Click()
    sql = Standar
    sql = sql + " and fecha >=#" & Format(DTPicker1.Value, "mm/dd/yyyy") & "# "
    sql = sql + " and fecha <=#" & Format(DTPicker2.Value, "mm/dd/yyyy") & "# "
    If Combo1.Text <> "" Then sql = sql + " and usuario='" & Combo1.Text & "'"
    If Combo2.Text <> "" Then sql = sql + " and Accion='" & Combo2.Text & "'"
    Mostrar_detalle sql
End Sub

Private Sub Command2_Click()
If MsgBox("Esta seguro que desea eliminar", vbYesNo) = vbYes Then
    Seguridad.respaldarData
    fm = Date - 60
    Base.Execute "delete from auditoria where fecha <=#" & fm & "#"
    MsgBox "Completado"
End If
End Sub

Private Sub Command3_Click()
    Unload Me
End Sub

Private Sub Form_Load()
    DTPicker2.Value = Date
    DTPicker1.Value = Date
    Mostrar_detalle Standar & " AND USUARIO='1ASDA' ORDER BY FECHA"
    Me.Caption = titulo2("Auditoria")
    LlenarCombo Combo1, "select identifica from cajero"
End Sub
